<template>
  <div class="app-container">
    <div class="searchBox">
      <el-form :inline="true">
        <el-form-item label="查询条件1：">
          <el-input v-model="search.demo1" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="查询条件2：">
          <el-input v-model="search.demo2" placeholder="请输入内容" />
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="searchQuery">查询</el-button>
          <el-button
            type="info"
            @click="
              search = {};
              searchQuery();
            "
          >重置</el-button>
        </el-form-item>
      </el-form>
    </div>

    <qm-table
      :data="query"
      key-prop="templateId"
      :form-validate="defaultFormValidate"
      is-custom-form
      menuType="text"
      :menuOptions="{ width: 100 }"
      :showView="false"
    >
      <qm-table-column field="code" sortable="true">唯一编码</qm-table-column>
      <qm-table-column field="name" sortable="true">名称</qm-table-column>
      <qm-table-column field="content" sortable="true" :show-overflow="true">
        内容
      </qm-table-column>
      <qm-table-column field="createdDate" sortable="true">
        创建时间
      </qm-table-column>
      <qm-table-column field="createdUserName" sortable="true">
        创建人
      </qm-table-column>
      <qm-table-column field="rate" sortable="true">
        频率，几天一次
      </qm-table-column>
      <qm-table-column field="maxSendTimes" sortable="true">
        最大发送次数
      </qm-table-column>

      <template #form="{ models, controlData ,disabled}">
        <create
          ref="create"
          :models="models"
          :control-data="controlData"
          :disabled="disabled"
        />
      </template>
    </qm-table>
  </div>
</template>

<script>
import Controller from '@/libs/framework/controller'
import Create from './create'
export default class Instance extends Controller {
  onBeforeInit() {
    this.urls = {
      query: '/message/sysMessageTemplate/query',
      save: '/message/sysMessageTemplate/save',
      delete: '/message/sysMessageTemplate/delete',
      entity: '/message/sysMessageTemplate/getEntity'
    }
  }

  mixin() {
    return {
      components: {
        Create
      },
      data() {
        return {}
      },
      methods: {}
    }
  }
}
</script>

<style scoped lang="scss"></style>
